{% extends 'TopxiaWebBundle:Course:Part/normal-header-layout.html.twig' %}

{% set layoutClass = 'after' %}

{% block before_content %}
  <ol class="breadcrumb">
    <li><a href="{{ path('homepage') }}">首页</a></li>
    {% for breadcrumb in breadcrumbs %}
      <li><a href="{{ path('course_explore',{'category':breadcrumb.code}) }}">{{ breadcrumb.name }}</a></li>
    {% endfor %}
    <li class="active">{{ course.title }}</li>
  </ol>
{% endblock %}

{% block content %}
  {{ load_script('course/common') }}

  <div class="course-header-top clearfix">

    {{ header_macro.picture(course) }}

    {{ header_macro.info(course, member, userVipStatus) }}

    <div class="course-operation">
      {{ header_macro.student_num(course) }}
      <ul class="course-data clearfix {% if not ( not member.fake|default(false) and member.role == 'student' and member.joinedType == 'course') %} two-col {% endif %}">
        {{ header_macro.favorite_btn(course, hasFavorited) }}
        {{ header_macro.share_btn(course) }}
        {% if not member.fake|default(false) and member.role == 'student' and member.joinedType == 'course' %}
          <li>
            {% if member.orderId  %}
              <a href="#modal" data-toggle="modal" data-url="{{ path('order_refund', {id:course.id, targetType:'course'}) }}">
                <p><i class="es-icon es-icon-exit"></i><p>
                <p>退出</p>
              </a>
            {% else %}
              <a id="exit-course-learning" class="course-exit-btn" href="javascript:;" data-url="{{ path('course_exit', {id:course.id}) }}"  data-goto="{{ path('course_show', {id:course.id}) }}" {% if member.role != 'student' %} disabled {% endif %}>
                <p><i class="es-icon es-icon-exit"></i><p>
                <p>退出</p>
              </a>
            {% endif %}
          </li>
        {% endif %}
      </ul>
    </div>
  </div>

  <div class="progress progress-sm">
    <div class="progress-bar" role="progressbar" style="width: {{ learnProgress.percent }}" data-toggle="tooltip" data-placement="right" title="{{ learnProgress.percent }}">
    </div>
  </div>

  <div class="course-header-bottom clearfix">
    <span class="pull-left">完成课时： {{ learnProgress.number }}/{{ learnProgress.total }}</span>
    {% if nextLearnLesson %}
      <a class="btn btn-lg btn-primary" href="{{ path('course_learn', {id:course.id}) }}#lesson/{{ nextLearnLesson.id }}">继续学习</a>
      <span class="next-class hidden-xs">下一课时：<a href="{{ path('course_learn', {id:course.id}) }}#lesson/{{ nextLearnLesson.id }}">{{ nextLearnLesson.title }}</a></span>
    {% endif %}
  </div>

{% endblock %}


